import typing as t
from flask_mobility.decorators import mobilized
from flask import render_template


def to_route(template_name_or_list: t.Union[str, t.List[str]], **context: t.Any) -> str:
    print("web----")
    return render_template(template_name_or_list, **context)


@mobilized(to_route)
def to_route(url, **context: t.Any) -> str:
    print("mobile----")
    return render_template("mobile/" + url, **context)
